﻿@{
    ViewBag.Title = "Edit Configuration";
    Layout = "~/Views/Master/_LoggedInLayout.cshtml";
}
@section headerscripts{
    <script type="text/javascript" src="../../Scripts/Application/UIControls.js"></script>
    <script type="text/javascript" src="../../Scripts/Pages/ConfigurationEditor.js"></script>
    <script type="text/javascript">
        
        //General functions~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        var configurationID = '@(ViewBag.ConfigurationId)';
        var configurationDataModel = null, clientController = null;
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        //Load~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        $(document).ready(function () {
            //Event handlers-------------------------------------------------------------------
            
            //Button handlers
            $("#SaveButton").bind("click", function () {
                clientController.SaveData();
            });
            //---------------------------------------------------------------------------------

            //Initialize
            $("#ConfigurationsMenuItem").attr("selected", "selected");

            //Load data
            $.timer(300, function () {

                //Instantiate/Initialize controls
                configurationDataModel = new ConfigurationDataModel(configurationID);
                configurationDataModel.Initialize();

                clientController = new ClientController($("#InnerViewArea"), $("#ConfigurationNameTextbox"), $("#MainHeaderLabel"), configurationDataModel);
                clientController.Initialize();
            });
        });
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    </script>
}
@section SubMenuSpecialBar{
    <div class="MenuItemSeparator">
        ></div>
    <div class="SubMenuSpecialBar">
        <input id="ConfigurationNameTextbox" class="Textbox" type="text" value="Please wait..." />
        <div class="Button-Toolbar" id="SaveButton">
            <img src="../../Content/themes/base/images/Icons/save.png" />
            <span>Save</span>
        </div>
        @*<div class="Button-Toolbar" id="UndoButton">
            <img src="../../Content/themes/base/images/Icons/undo-toolbar.png" />
            <span>Undo</span>
        </div>*@
    </div>
}
@section RootBreadCrumb {
Edit Configuration
}

<div class="SingleColumn">
    @*InteractiveView*@
    <div id="InteractiveViewBox" class="RoundedBox">
        <div class="BoxHeader">
            <div class="BoxInnerHeader">
                <span id="MainHeaderLabel" class="HeaderLabel"></span>
            </div>
        </div>
        <div class="BoxContent">
            <div id="InnerViewArea">
                <div style="clear: both">
                </div>
            </div>
        </div>
        <div class="BoxFooter">
            <div class="BoxInnerFooter">
            </div>
        </div>
    </div>
</div>
